package com.hyh.prize.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hyh.prize.entity.TabHallUsermessage;
import com.hyh.prize.mapper.UserMapper;
import com.hyh.prize.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, TabHallUsermessage> implements UserService {

    /**
     * 通过手机号获得用户姓名
     * @param id
     * @return
     */
    public String getNameById(String id){
        QueryWrapper<TabHallUsermessage> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("pnumber",id);
        TabHallUsermessage usermessage = this.getOne(queryWrapper);
        if(usermessage!=null){
            return usermessage.getIdname();
        }
        return null;
    }
}
